Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom implementations of optional and string_view #6366

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Oct 18, 2024

Summary:
Now that we're using C++17, we don't need to maintain custom implementations of optional and string_view.

The standard optional has an implicit ctor that causes ambiguities in some reduce_util.h functions. Add explicit overrides to resolve the ambiguities.

Note that this is technically an API break, since exec_aten::optional is changing in a way that can break some existing code. There is no way to roll this out incrementally, though, and there should not be many examples of user code that would break because of this change.

Differential Revision: D64634702

Summary:
Now that we're using C++17, we don't need to maintain custom implementations of `optional` and `string_view`.

The standard optional has an implicit ctor that causes ambiguities in some reduce_util.h functions. Add explicit overrides to resolve the ambiguities.

Note that this is technically an API break, since exec_aten::optional is changing in a way that can break some existing code. There is no way to roll this out incrementally, though, and there should not be many examples of user code that would break because of this change.

Differential Revision: D64634702
Copy link

pytorch-bot bot commented Oct 18, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6366

Note: Links to docs will display an error until the docs builds have been completed.

❌ 30 New Failures, 3 Unrelated Failures

As of commit f3cb8c3 with merge base 4d7b294 (image):

NEW FAILURES - The following jobs have failed:

  • Build documentation / build (buck2) / Build doc (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-custom-ops-linux (buck2) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-custom-ops-linux (cmake) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-eval_llama-mmlu-linux / linux-job (gh)
    ##[error]fatal: unable to access 'https://github.com/Maratyszcza/pthreadpool.git/': The requested URL returned error: 504
  • pull / test-eval_llama-wikitext-linux / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-llama_runner_eager-linux / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-llama-runner-linux (bf16, buck2, custom) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-linux (bf16, cmake, custom) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-linux (bf16, cmake, portable) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-llama-runner-linux (fp32, buck2, portable) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-linux (fp32, buck2, xnnpack+custom) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-linux (fp32, buck2, xnnpack+custom+qe) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-linux (fp32, cmake, portable) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-llama-runner-linux (fp32, cmake, xnnpack+custom+qe) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llama-runner-qnn-linux (fp32, cmake, qnn) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-llava-runner-linux / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-models-linux (buck2, mv3, portable, linux.2xlarge, 90) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-models-linux (buck2, mv3, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-models-linux (cmake, mv3, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-models-linux (cmake, vit, portable, linux.2xlarge, 90) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / test-models-linux (cmake, vit, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-phi-3-mini-runner-linux / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-pybind-build-linux (cmake) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-quantized-aot-lib-linux (cmake) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-selective-build-linux (buck2) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-selective-build-linux (cmake) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / test-setup-linux-gcc (cmake) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of ‘struct executorch::extension::internal::type_convert<std::optional<_Tp>, std::optional<_Up> >’
  • pull / unittest / linux / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'
  • pull / unittest / macos / macos-job (gh)
    /Users/ec2-user/runner/_work/executorch/executorch/pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:171:8: error: redefinition of 'type_convert<torch::executor::optional<F>, c10::optional<T>>'
  • pull / unittest-arm (buck2) / linux-job (gh)
    /pytorch/executorch/extension/llm/custom_ops/../../../../executorch/extension/aten_util/make_aten_functor_from_et_functor.h:93:12: error: no matching conversion for static_cast from 'std::optional<at::Tensor>' to 'std::optional<executorch::runtime::etensor::Tensor>'

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 18, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64634702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants